package xq.pug.feign.service.user;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import xq.pug.common.result.R;
import xq.pug.feign.dto.user.DeductionFeignReqDTO;
import xq.pug.feign.dto.user.DeductionFeignRespDTO;
import xq.pug.feign.dto.user.UserFeignReqDTO;
import xq.pug.feign.dto.user.UserFeignRespDTO;

/**
 * @program: xq_pug_alibabacloud_parent
 * @description: 用户模块的feign接口
 * @author: Mr.Ren
 * @create: 2023-04-17 22:15
 **/
@FeignClient(value = "user-service")
public interface UserServiceFeign {

    @GetMapping("/user/getUser")
    R<String> getUser();

    /**
     * 查询用户
     * @param dto
     * @return
     */
    @PostMapping("/user/queryUser")
    R<UserFeignRespDTO> queryUser(@RequestBody UserFeignReqDTO dto);

    /**
     * 用户扣款
     * @param dto
     * @return
     */
    @PostMapping("/user/deduction")
    R<DeductionFeignRespDTO> deduction(@RequestBody DeductionFeignReqDTO dto);
}
